
.panel {
  
  margin: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  gap: 1rem;

  header, .panel-header {
    
    display: flex;
    flex-direction: row;
    align-items: center;
    font-weight: var(--font-weight-medium);
    gap: 0.25rem;

    margin-bottom: 0px !important;

    label {
      flex: 1;

      .tag {
        margin-left: 0.25rem;
        position: relative;
        top: -2px;
      }

      .subtitle {
        font-size: 12px;
        margin-top: 0.25rem;
        font-weight: 200;
        color: var(--faded-text-color);
      }
    }

    .icon {
      cursor: pointer;
      width: 1.125rem;
      height: 1.125rem;
      color: var(--color-on-surface-variant);
    }

    .spinner {
      transform: scale(125%);
    }

    button {
      margin: 0px;
    }

  }

  main, .panel-body {
    flex-grow: 1;
  }

  main, .panel-body {

    display: flex;
    flex-direction: column;
    overflow: auto;
    gap: 1rem;
    padding-right: 0.5rem;

    &:has(input, select, textarea) {
      padding-left: 2px;
    }

    &:has(.panel-item .actions) {
      padding-top: 0.5rem;
      padding-bottom: 0.5rem;
    }

    .panel-item {

      margin-left: 0.25rem;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 1rem;

      .leading {
        flex: 0 0 1.5rem;
        font-size: 17.5px;
        svg {
          width: var(--icon-lg);
          height: var(--icon-lg);
        }

        &:has(a) {
          cursor: pointer;
        }
      }

      .info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
        overflow: hidden;
        cursor: pointer;
        
        .text, .subtext {
          overflow: hidden;
          text-overflow: ellipsis;
          text-align: left;
          white-space: nowrap;
          word-break: break-all;
          margin: 0;
          padding: 0;
        }

        .text {
          font-size: 14px;
          font-weight: var(--font-weight-medium);
        }

        .subtext {
          font-weight: 200;
          font-size: 12px;
          color: var(--faded-text-color);
        }
      }

      .actions {

        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 0px;
        gap: 0.75rem;

        > div {
          height: 1.25rem;
        }

        svg {
          width: var(--icon-md);
          height: var(--icon-md);
          opacity: 0.45;
          cursor: pointer;
        }

        .icon.error:hover {
          color: red;
        }

        .disabled {
          opacity: 0.3;
          pointer-events: none;
        }

      }

    }
  }

  main.empty, .panel-empty {
    padding: 2rem 25%;
    text-align: center;
    font-size: 16px;
    font-weight: 300;
    color: var(--faded-text-color);
  }

  footer, .panel-footer {

    display: flex;
    flex-direction: row;
    gap: 0.5rem;

    button {
      padding: 0.5rem 1rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: var(--font-weight-medium);
      color: #1B4FB2;
      svg {
        color: #1B4FB2;
      }
    }

  }

  &:has(footer, .panel-footer) .panel-empty {
    flex-grow: 1;
  }

  &.collapsed {
    
    flex-grow: 0;
    
    header, .panel-header {
      .toggle-panel {
        transform: rotate(180deg);
      }
    }
    
    
    > :not(header, .panel-header) {
      display: none;
    }
  }

}
